﻿//选择工序首页
var columns =
            [
                 { display: 'ID', name: 'ID', type: 'text', hide: 1 },
                { display: '产品名称', name: 'ProductName', mintWidth: 80, width: 120 },
                { display: '工序编号', name: 'ProcedureNo', mintWidth: 80, width: 120 },
                { display: '工序名称', name: 'ProcedureName', mintWidth: 80, width: 140 },
                { display: '工时费(元)', name: 'HourMoney', mintWidth: 80, width: 140 },
                 { display: '备注', name: 'Remarks', mintWidth: 140, width: 200 }
             ];

var manager;
//init controls
$(document).ready(function () {
    $("#btnConfirm").unbind("click").bind("click", selectOperation);
    initligerGrid();
});

function initligerGrid() {
    manager = null;
    manager = $("#ProductProcedureGrid").ligerGrid({
        columns: columns,
        title: '工序列表',
        showTitle: true,
        width: '100%',
        enabledSort: true,
        height: '80%',
        checkbox: false,
        rownumbers: true,
        parms: { ProductName: $("#ProductName").val(), ProductCode: $("#ProductCode").val(), ProcedureGXName: $("#ProcedureGXName").val(), ProductGG: $("#ProductGG").val() },
        url: "../ProductProcedure/GetJsonOfProductProcedures?rand=" + Math.random()
    });
}


//select node 
function selectOperation() {
    var row = manager.getSelectedRow();
    if (!row) {
        $.ligerDialog.success('请选择要工序!'); return;
    }
    window.returnValue = [row["ProductName"].toString(), row["ID"].toString()];
    window.close();
}


